<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
>
<head>
    <title>编辑广告</title>
      
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/static/h-ui/css/H-ui.min.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/static/h-ui.admin/css/H-ui.admin.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/lib/Hui-iconfont/1.0.8/iconfont.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/extend/iconfont/iconfont.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/static/h-ui.admin/skin/default/skin.css}" id="skin" />
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/static/h-ui.admin/css/style.css}" />
    <link th:href="@{/h-ui/lib/lightbox2/2.8.1/css/lightbox.css}" rel="stylesheet" type="text/css" >
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/lib/select2/select2.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/lib/webuploader/0.1.5/webuploader.css}"/>

    <script type="text/javascript" th:src="@{/js/lib/jquery-1.11.0.min.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/lib/layer/2.4/layer.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/lib/jquery.validation/1.14.0/jquery.validate.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/lib/jquery.validation/1.14.0/validate-methods.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/lib/jquery.validation/1.14.0/messages_zh.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/static/h-ui/js/H-ui.min.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/static/h-ui.admin/js/H-ui.admin.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/lib/My97DatePicker/4.8/WdatePicker.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/lib/webuploader/0.1.5/webuploader.min.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/lib/laypage/1.3/laypage.js}"></script>
    <script type="text/javascript" th:src="@{/js/common/layerUtil.js}"></script>
    <script type="text/javascript" th:src="@{/js/common/common.js}"></script>
    <script type="text/javascript" th:src="@{/js/common/webUploadUtil.js}"></script>
    <script type="text/javascript" th:src="@{/js/lib/vue.js}"></script>
</head>

<body layout:fragment="content">

<article class="page-container">
    <form class="form form-horizontal" id="form-advert-edit">
        <input type="hidden" name="tokenForm" th:value="${#session.getAttribute('tokenForm')}" />
        <input type="hidden" th:name="id" th:value="${advert?.id}"/>
        
        <input type="hidden" th:name="advertPositionId" th:value="${advertPosition.id}"/>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>广告位ID：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span th:text="${advertPosition?.name}"></span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>广告位ID：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入广告位ID" th:id="advertPositionId" th:name="advertPositionId" th:value="${advert?.advertPositionId}" />
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>广告位置：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入广告位置" th:id="name" th:name="name" th:value="${advert?.name}" />
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>标题：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入标题" th:id="title" th:name="title" th:value="${advert?.title}" />
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>链接地址：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入链接地址" th:id="url" th:name="url" th:value="${advert?.url}" />
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>类型(0:图文，1：图片，2：视频）：</label>
            <div class="formControls col-xs-8 col-sm-9">
				<div class="radio-box">
					<input type="radio" id="type-1" checked="checked" th:name="type" th:value="0" th:checked="*{type} == '0'"/>
					<label for="sex-1">文字</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="type-2" checked="checked" th:name="type" th:value="1" th:checked="*{type} == '1'"/>
					<label for="sex-1">图片</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="type-3" checked="checked" th:name="type" th:value="2" th:checked="*{type} == '22'"/>
					<label for="sex-1">视频</label>
				</div>
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>展示图片：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <div class="uploader-thum-container">
                    <div id="fileListPreId" class="uploader-list">
                        <th:block th:if="${content?.img} == null">
                            <img th:src="@{/h-ui/lib/webuploader/0.1.5/images/image.png}" height="81" width="81"/>
                        </th:block>
                        <th:block th:unless="${content?.img} == null">
                            <img th:src="${imageUrl} + ${content?.img}" height="81" width="81"/>
                        </th:block>
                    </div>
                    <div id="filePicker">选择图片</div>
                    <input type="hidden" th:id="picImg" th:name="picImg" th:value="${advert?.picImg}" />
                </div>
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>广告内容：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入广告内容" th:id="content" th:name="content" th:value="${advert?.content}" />
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>广告起始时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="beginTime" name="beginTime" class="input-text Wdate" style="width:220px;" th:value="${#dates.format(advert?.time,'yyyy-MM-dd HH:mm:ss')s}" />
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>广告结束时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="endTime" name="endTime" class="input-text Wdate" style="width:220px;" th:value="${#dates.format(advert?.time,'yyyy-MM-dd HH:mm:ss')s}" />
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>排序：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" value="" class="input-text spinner" placeholder="请输入排序"  id="sort" name="sort" th:value="${advert?.sort}" />
            </div>
        </div>
        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>备注信息：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入备注信息" th:id="remarks" th:name="remarks" th:value="${advert?.remarks}" />
            </div>
        </div>
        
        
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交</button>
                <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</article>

<script type="text/javascript" th:src="@{/ueditor/ueditor.config.js}"></script>
<script type="text/javascript" th:src="@{/ueditor/ueditor.all.min.js}"></script>
<script type="text/javascript" th:src="@{/ueditor/lang/zh-cn/zh-cn.js}"></script>
<script type="text/javascript" th:src="@{/js/admin/advert/advert-edit.js}"></script>
<script th:inline="javascript">
</script>
</body>
</html>